﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QModbusTcpClient>
#include <QModbusDataUnit>
#include <QTimer>


namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();
    bool Connect_to_modbus(QString IP_address, int Port);
    void readRequest();

signals:
    statechange_on();
    statechange_off();




public slots:
    void StateChangeHandler();
    void readReady();


private:
    Ui::MainWindow *ui;
    QModbusClient * My_client;
    QTimer *readtime;
};

#endif // MAINWINDOW_H
